home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Aminet 52
/
Aminet 52 (2002)(GTI - Schatztruhe)[!][Dec 2002].iso
/
Aminet
/
dev
/
gg
/
ncurses-5.3.lha
/
ncurses-5.3
/
headers.sh
< prev
next >
Wrap
Linux/UNIX/POSIX Shell Script
|
2002-10-24
|
901b
|
38 lines
#! /bin/sh
# This shell script is generated by the 'configure' script. It is invoked in a
# subdirectory of the build tree. It generates a sed-script in the parent
# directory that is used to adjust includes for header files that reside in a
# subdirectory of /usr/include, etc.
PRG=""
while test $# != 3
do
PRG="$PRG $1"; shift
done
DST=$1
REF=$2
SRC=$3
TMPSRC=${TMPDIR-/tmp}/`basename $SRC`$$
TMPSED=${TMPDIR-/tmp}/headers.sed$$
echo installing $SRC in $DST
case $DST in
/*/include/*)
END=`basename $DST`
for i in `cat $REF/../*/headers |fgrep -v "#"`
do
NAME=`basename $i`
echo "s/<$NAME>/<$END\/$NAME>/" >> $TMPSED
done
;;
*)
echo "" >> $TMPSED
;;
esac
rm -f $TMPSRC
sed -f $TMPSED $SRC > $TMPSRC
NAME=`basename $SRC`
# Just in case someone gzip'd manpages, remove the conflicting copy.
test -f $DST/$NAME.gz && rm -f $DST/$NAME.gz
eval $PRG $TMPSRC $DST/$NAME
rm -f $TMPSRC $TMPSED